/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "KEO_BAN_THANG", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "KeoBanThang.findAll", query = "SELECT k FROM KeoBanThang k"),
    @NamedQuery(name = "KeoBanThang.findById", query = "SELECT k FROM KeoBanThang k WHERE k.id = :id"),
    @NamedQuery(name = "KeoBanThang.findByDoi1", query = "SELECT k FROM KeoBanThang k WHERE k.doi1 = :doi1"),
    @NamedQuery(name = "KeoBanThang.findByDoi2", query = "SELECT k FROM KeoBanThang k WHERE k.doi2 = :doi2"),
    @NamedQuery(name = "KeoBanThang.findByTySo", query = "SELECT k FROM KeoBanThang k WHERE k.tySo = :tySo"),
    @NamedQuery(name = "KeoBanThang.findByTyLeCuoc", query = "SELECT k FROM KeoBanThang k WHERE k.tyLeCuoc = :tyLeCuoc"),
    @NamedQuery(name = "KeoBanThang.findByThoiGianTao", query = "SELECT k FROM KeoBanThang k WHERE k.thoiGianTao = :thoiGianTao"),
    @NamedQuery(name = "KeoBanThang.findByThoiGianCapNhatCuoi", query = "SELECT k FROM KeoBanThang k WHERE k.thoiGianCapNhatCuoi = :thoiGianCapNhatCuoi"),
    @NamedQuery(name = "KeoBanThang.findByThoiGianStr", query = "SELECT k FROM KeoBanThang k WHERE k.thoiGianStr = :thoiGianStr")})
public class KeoBanThang implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Size(max = 30)
    @Column(name = "DOI_1")
    private String doi1;
    @Size(max = 30)
    @Column(name = "DOI_2")
    private String doi2;
    @Size(max = 15)
    @Column(name = "TY_SO")
    private String tySo;
    @Column(name = "TY_LE_CUOC")
    private BigInteger tyLeCuoc;
    @Column(name = "THOI_GIAN_TAO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date thoiGianTao;
    @Column(name = "THOI_GIAN_CAP_NHAT_CUOI")
    @Temporal(TemporalType.TIMESTAMP)
    private Date thoiGianCapNhatCuoi;
    @Size(max = 20)
    @Column(name = "THOI_GIAN_STR")
    private String thoiGianStr;
    @JoinColumn(name = "ID_TRAN_DAU", referencedColumnName = "ID")
    @ManyToOne
    private TranDau idTranDau;

    public KeoBanThang() {
    }

    public KeoBanThang(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDoi1() {
        return doi1;
    }

    public void setDoi1(String doi1) {
        this.doi1 = doi1;
    }

    public String getDoi2() {
        return doi2;
    }

    public void setDoi2(String doi2) {
        this.doi2 = doi2;
    }

    public String getTySo() {
        return tySo;
    }

    public void setTySo(String tySo) {
        this.tySo = tySo;
    }

    public BigInteger getTyLeCuoc() {
        return tyLeCuoc;
    }

    public void setTyLeCuoc(BigInteger tyLeCuoc) {
        this.tyLeCuoc = tyLeCuoc;
    }

    public Date getThoiGianTao() {
        return thoiGianTao;
    }

    public void setThoiGianTao(Date thoiGianTao) {
        this.thoiGianTao = thoiGianTao;
    }

    public Date getThoiGianCapNhatCuoi() {
        return thoiGianCapNhatCuoi;
    }

    public void setThoiGianCapNhatCuoi(Date thoiGianCapNhatCuoi) {
        this.thoiGianCapNhatCuoi = thoiGianCapNhatCuoi;
    }

    public String getThoiGianStr() {
        return thoiGianStr;
    }

    public void setThoiGianStr(String thoiGianStr) {
        this.thoiGianStr = thoiGianStr;
    }

    public TranDau getIdTranDau() {
        return idTranDau;
    }

    public void setIdTranDau(TranDau idTranDau) {
        this.idTranDau = idTranDau;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KeoBanThang)) {
            return false;
        }
        KeoBanThang other = (KeoBanThang) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.KeoBanThang[ id=" + id + " ]";
    }
}
